<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="/css/default.css" type="text/css" />
<title>查询部门名</title>
<script language="javascript">
  function validate(){
	  var v_deptName = document.getElementById("deptName").value;
	  if ((v_deptName==null)||(v_deptName=="")){
		  alert("部门名不能为空!");
		  return false;
	  }
	  return true;
  }
  function selectDept(di,dn){
	  //var frm =window.parent.window.frames['main'];
	  //frm.test();
	  window.opener.document.getElementById("stock_id_new").value=di;
	  window.opener.document.getElementById("stock_name_new").value=dn;
	  //window.opener.location="/article/article.do";
      window.close();

  }
</script>
</head>

<body>
<div class="mobile_out_sheet">
  <s:form action="getdeptid" namespace="/mobile" method="POST" theme="simple" onsubmit="return validate();">
  <div class="mobile_th">查询部门信息</div>
  
  <table class="mobile_out_sheet_table" cellpadding="0" border="0" cellspacing="0" width="100%">
  <tr>
    <td width="30%" align="right" >请输入部门名</td><td align="left" width="50%"><s:textfield id="deptName" name="deptName" size="30"/></td>
  <td width="20%"><s:submit value="查询" /></td></tr>
  </table>
  
  <div class="mobile_th">手机信息</div>
  <table class="mobile_out_detail_table" cellpadding="0" border="0" cellspacing="0" width="100%" style="margin-top:10px;">
  <tr><th width="10%">选择</th><th width="30%">部门编号</th><th width="60%">名称</th></tr>
  <s:iterator value="curList" status="count" >
         <s:if test="#count.odd">
          <tr ><td class="table_row_odd"><a href='#' onClick="selectDept('<s:property value="departId" />','<s:property value="deptName" />')">选择</a></td>
               <td class="table_row_odd"><s:property value="departId" /></td>
               <td class="table_row_odd"><s:property value="deptName" /></td>
          </tr>
         </s:if>
         <s:else>
          <tr ><td class="table_row_even"><a href='#' onClick="selectDept('<s:property value="departId" />','<s:property value="deptName" />')">选择</a></td>
               <td class="table_row_even"><s:property value="departId" /></td>
               <td class="table_row_even"><s:property value="deptName" /></td>
          </tr>
         </s:else>
        </s:iterator>
  </table>
  
  
  <div class="mobile_out_detail_table_foot">
  <table width="500px" bordercolor="#cccccc" cellpadding="0" cellspacing="0" border="0">
      <tr>
        <td width="100px"></td>
        <td><s:submit action="firstPagedetailAlert" value="首页" /></td>
        <td><s:submit action="prioPagedetailAlert" value="前一页" /></td>
        <td><s:textfield name="currPage" size="4" maxlength="4"/></td>
        <td><s:submit action="goToPagedetailAlert" value="前往" /></td>
        <td><s:submit action="nextPagedetailAlert" value="后一页" /></td>
        <td><s:submit action="lastPagedetailAlert" value="最后一页"/></td>
      </tr>
      </table>
  </div>
   </s:form>
</div>
</body>
</html>